﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using UnityEngine;

// Token: 0x020002F0 RID: 752
public class Expression : MonoBehaviour
{
	// Token: 0x06001274 RID: 4724 RVA: 0x000957E8 File Offset: 0x000939E8
	public virtual void SetCharaTransform(Transform trf)
	{
		this.trfChara = trf;
	}

	// Token: 0x06001275 RID: 4725 RVA: 0x000957F4 File Offset: 0x000939F4
	public virtual void Initialize()
	{
		if (null == this.trfChara)
		{
			return;
		}
		this.FindObjectAll(this.dictTrf, this.trfChara);
		Transform transform = null;
		foreach (global::Expression.ScriptInfo scriptInfo in this.info)
		{
			if (scriptInfo.enableLookAt && scriptInfo.lookAt != null)
			{
				if (!this.dictTrf.TryGetValue(scriptInfo.lookAt.lookAtName, out transform))
				{
					global::Debug.LogWarning(string.Format("ない : {0}", scriptInfo.lookAt.lookAtName));
				}
				else
				{
					scriptInfo.lookAt.SetLookAtTransform(transform);
					if (!this.dictTrf.TryGetValue(scriptInfo.lookAt.targetName, out transform))
					{
						global::Debug.LogWarning(string.Format("ない : {0}", scriptInfo.lookAt.targetName));
					}
					else
					{
						scriptInfo.lookAt.SetTargetTransform(transform);
						this.dictTrf.TryGetValue(scriptInfo.lookAt.upAxisName, out transform);
						scriptInfo.lookAt.SetUpAxisTransform(transform);
					}
				}
			}
			if (scriptInfo.enableCorrect && scriptInfo.correct != null)
			{
				if (!this.dictTrf.TryGetValue(scriptInfo.correct.correctName, out transform))
				{
					global::Debug.LogWarning(string.Format("ない : {0}", scriptInfo.correct.correctName));
				}
				else
				{
					scriptInfo.correct.SetCorrectTransform(transform);
					this.dictTrf.TryGetValue(scriptInfo.correct.referenceName, out transform);
					scriptInfo.correct.SetReferenceTransform(transform);
				}
			}
		}
	}

	// Token: 0x06001276 RID: 4726 RVA: 0x00095994 File Offset: 0x00093B94
	public virtual void FindObjectAll(Dictionary<string, Transform> _dictTrf, Transform _trf)
	{
		if (!_dictTrf.ContainsKey(_trf.name))
		{
			_dictTrf[_trf.name] = _trf;
		}
		for (int i = 0; i < _trf.childCount; i++)
		{
			this.FindObjectAll(_dictTrf, _trf.GetChild(i));
		}
	}

	// Token: 0x06001277 RID: 4727 RVA: 0x000959E4 File Offset: 0x00093BE4
	public virtual void EnableCategory(int categoryNo, bool _enable)
	{
		for (int i = 0; i < this.info.Length; i++)
		{
			if (this.info[i].categoryNo == categoryNo)
			{
				this.info[i].enable = _enable;
			}
		}
	}

	// Token: 0x06001278 RID: 4728 RVA: 0x00095A2C File Offset: 0x00093C2C
	public virtual void EnableIndex(int indexNo, bool _enable)
	{
		if (0 <= indexNo && indexNo < this.info.Length)
		{
			this.info[indexNo].enable = _enable;
		}
	}

	// Token: 0x06001279 RID: 4729 RVA: 0x00095A54 File Offset: 0x00093C54
	public virtual void Start()
	{
	}

	// Token: 0x0600127A RID: 4730 RVA: 0x00095A58 File Offset: 0x00093C58
	public virtual void LateUpdate()
	{
		if (this.info == null)
		{
			return;
		}
		if (this.enable)
		{
			foreach (global::Expression.ScriptInfo scriptInfo in this.info)
			{
				scriptInfo.Update();
			}
		}
	}

	// Token: 0x0600127B RID: 4731 RVA: 0x00095AA4 File Offset: 0x00093CA4
	public virtual void OnDestroy()
	{
		if (this.info == null)
		{
			return;
		}
		foreach (global::Expression.ScriptInfo scriptInfo in this.info)
		{
			scriptInfo.Destroy();
		}
	}

	// Token: 0x0600127C RID: 4732 RVA: 0x00095AE4 File Offset: 0x00093CE4
	public virtual bool LoadSetting(string assetBundleName, string assetName)
	{
		TextAsset textAsset = global::CommonLib.LoadAsset<TextAsset>(assetBundleName, assetName, false, string.Empty);
		if (null == textAsset)
		{
			global::Debug.LogError("あってはならない");
			return false;
		}
		string text = textAsset.text.Replace("\r", string.Empty);
		string[] collection = text.Split(new char[]
		{
			'\n'
		});
		List<string> list = new List<string>();
		list.AddRange(collection);
		global::AssetBundleManager.UnloadAssetBundle(assetBundleName, true, null);
		return this.LoadSettingSub(list);
	}

	// Token: 0x0600127D RID: 4733 RVA: 0x00095B5C File Offset: 0x00093D5C
	public virtual bool LoadSetting(string path)
	{
		List<string> list = new List<string>();
		using (FileStream fileStream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))
		{
			using (StreamReader streamReader = new StreamReader(fileStream, Encoding.UTF8))
			{
				while (streamReader.Peek() > -1)
				{
					list.Add(streamReader.ReadLine());
				}
			}
		}
		return this.LoadSettingSub(list);
	}

	// Token: 0x0600127E RID: 4734 RVA: 0x00095BEC File Offset: 0x00093DEC
	public virtual bool LoadSettingSub(List<string> slist)
	{
		if (slist.Count == 0)
		{
			return false;
		}
		string[] array = slist[0].Split(new char[]
		{
			'\t'
		});
		int num = int.Parse(array[0]);
		if (num > slist.Count - 1)
		{
			return false;
		}
		this.info = new global::Expression.ScriptInfo[num];
		for (int i = 0; i < num; i++)
		{
			array = slist[i + 1].Split(new char[]
			{
				'\t'
			});
			this.info[i] = new global::Expression.ScriptInfo();
			this.info[i].index = i;
			int num2 = 0;
			this.info[i].categoryNo = int.Parse(array[num2++]);
			this.info[i].enableLookAt = (array[num2++] == "○");
			if (this.info[i].enableLookAt)
			{
				this.info[i].lookAt.lookAtName = array[num2++];
				if ("0" == this.info[i].lookAt.lookAtName)
				{
					this.info[i].lookAt.lookAtName = string.Empty;
				}
				else
				{
					this.info[i].elementName = this.info[i].lookAt.lookAtName;
				}
				this.info[i].lookAt.targetName = array[num2++];
				if ("0" == this.info[i].lookAt.targetName)
				{
					this.info[i].lookAt.targetName = string.Empty;
				}
				this.info[i].lookAt.targetAxisType = (global::Expression.LookAt.AxisType)((int)Enum.Parse(typeof(global::Expression.LookAt.AxisType), array[num2++]));
				this.info[i].lookAt.upAxisName = array[num2++];
				if ("0" == this.info[i].lookAt.upAxisName)
				{
					this.info[i].lookAt.upAxisName = string.Empty;
				}
				this.info[i].lookAt.upAxisType = (global::Expression.LookAt.AxisType)((int)Enum.Parse(typeof(global::Expression.LookAt.AxisType), array[num2++]));
				this.info[i].lookAt.sourceAxisType = (global::Expression.LookAt.AxisType)((int)Enum.Parse(typeof(global::Expression.LookAt.AxisType), array[num2++]));
				this.info[i].lookAt.limitAxisType = (global::Expression.LookAt.AxisType)((int)Enum.Parse(typeof(global::Expression.LookAt.AxisType), array[num2++]));
				this.info[i].lookAt.rotOrder = (global::Expression.LookAt.RotationOrder)((int)Enum.Parse(typeof(global::Expression.LookAt.RotationOrder), array[num2++]));
				this.info[i].lookAt.limitMin = float.Parse(array[num2++]);
				this.info[i].lookAt.limitMax = float.Parse(array[num2++]);
			}
			else
			{
				num2 += 10;
			}
			this.info[i].enableCorrect = (array[num2++] == "○");
			if (this.info[i].enableCorrect)
			{
				this.info[i].correct.correctName = array[num2++];
				if ("0" == this.info[i].correct.correctName)
				{
					this.info[i].correct.correctName = string.Empty;
				}
				else
				{
					this.info[i].elementName = this.info[i].correct.correctName;
				}
				this.info[i].correct.referenceName = array[num2++];
				if ("0" == this.info[i].correct.referenceName)
				{
					this.info[i].correct.referenceName = string.Empty;
				}
				this.info[i].correct.calcType = (global::Expression.Correct.CalcType)((int)Enum.Parse(typeof(global::Expression.Correct.CalcType), array[num2++]));
				this.info[i].correct.rotOrder = (global::Expression.Correct.RotationOrder)((int)Enum.Parse(typeof(global::Expression.Correct.RotationOrder), array[num2++]));
				this.info[i].correct.charmRate = float.Parse(array[num2++]);
				this.info[i].correct.useRX = (array[num2++] == "○");
				this.info[i].correct.valRXMin = float.Parse(array[num2++]);
				this.info[i].correct.valRXMax = float.Parse(array[num2++]);
				this.info[i].correct.useRY = (array[num2++] == "○");
				this.info[i].correct.valRYMin = float.Parse(array[num2++]);
				this.info[i].correct.valRYMax = float.Parse(array[num2++]);
				this.info[i].correct.useRZ = (array[num2++] == "○");
				this.info[i].correct.valRZMin = float.Parse(array[num2++]);
				this.info[i].correct.valRZMax = float.Parse(array[num2++]);
			}
		}
		return true;
	}

	// Token: 0x04001846 RID: 6214
	public Transform trfChara;

	// Token: 0x04001847 RID: 6215
	public global::Expression.ScriptInfo[] info;

	// Token: 0x04001848 RID: 6216
	public bool enable = true;

	// Token: 0x04001849 RID: 6217
	protected Dictionary<string, Transform> dictTrf = new Dictionary<string, Transform>();

	// Token: 0x020002F1 RID: 753
	[Serializable]
	public class LookAt
	{
		// Token: 0x0600127F RID: 4735 RVA: 0x000961E0 File Offset: 0x000943E0
		public LookAt()
		{
			this.trfLookAt = null;
			this.trfTarget = null;
			this.trfUpAxis = null;
		}

		// Token: 0x17000291 RID: 657
		// (get) Token: 0x06001280 RID: 4736 RVA: 0x0009624C File Offset: 0x0009444C
		// (set) Token: 0x06001281 RID: 4737 RVA: 0x00096254 File Offset: 0x00094454
		public Transform trfLookAt { get; private set; }

		// Token: 0x17000292 RID: 658
		// (get) Token: 0x06001282 RID: 4738 RVA: 0x00096260 File Offset: 0x00094460
		// (set) Token: 0x06001283 RID: 4739 RVA: 0x00096268 File Offset: 0x00094468
		public Transform trfTarget { get; private set; }

		// Token: 0x17000293 RID: 659
		// (get) Token: 0x06001284 RID: 4740 RVA: 0x00096274 File Offset: 0x00094474
		// (set) Token: 0x06001285 RID: 4741 RVA: 0x0009627C File Offset: 0x0009447C
		public Transform trfUpAxis { get; private set; }

		// Token: 0x06001286 RID: 4742 RVA: 0x00096288 File Offset: 0x00094488
		public virtual void SetLookAtTransform(Transform trf)
		{
			this.trfLookAt = trf;
		}

		// Token: 0x06001287 RID: 4743 RVA: 0x00096294 File Offset: 0x00094494
		public virtual void SetTargetTransform(Transform trf)
		{
			this.trfTarget = trf;
		}

		// Token: 0x06001288 RID: 4744 RVA: 0x000962A0 File Offset: 0x000944A0
		public virtual void SetUpAxisTransform(Transform trf)
		{
			this.trfUpAxis = trf;
		}

		// Token: 0x06001289 RID: 4745 RVA: 0x000962AC File Offset: 0x000944AC
		public virtual void Update()
		{
			if (null == this.trfTarget || null == this.trfLookAt)
			{
				return;
			}
			Vector3 upVector = this.GetUpVector();
			Vector3 vector = Vector3.Normalize(this.trfTarget.position - this.trfLookAt.position);
			Vector3 vector2 = Vector3.Normalize(Vector3.Cross(upVector, vector));
			Vector3 vector3 = Vector3.Cross(vector, vector2);
			if (this.targetAxisType == global::Expression.LookAt.AxisType.RevX || this.targetAxisType == global::Expression.LookAt.AxisType.RevY || this.targetAxisType == global::Expression.LookAt.AxisType.RevZ)
			{
				vector = -vector;
				vector2 = -vector2;
			}
			Vector3 xvec = Vector3.zero;
			Vector3 yvec = Vector3.zero;
			Vector3 zvec = Vector3.zero;
			switch (this.targetAxisType)
			{
			case global::Expression.LookAt.AxisType.X:
			case global::Expression.LookAt.AxisType.RevX:
				xvec = vector;
				if (this.sourceAxisType == global::Expression.LookAt.AxisType.Y)
				{
					yvec = vector3;
					zvec = -vector2;
				}
				else if (this.sourceAxisType == global::Expression.LookAt.AxisType.RevY)
				{
					yvec = -vector3;
					zvec = vector2;
				}
				else if (this.sourceAxisType == global::Expression.LookAt.AxisType.Z)
				{
					yvec = vector2;
					zvec = vector3;
				}
				else if (this.sourceAxisType == global::Expression.LookAt.AxisType.RevZ)
				{
					yvec = -vector2;
					zvec = -vector3;
				}
				break;
			case global::Expression.LookAt.AxisType.Y:
			case global::Expression.LookAt.AxisType.RevY:
				yvec = vector;
				if (this.sourceAxisType == global::Expression.LookAt.AxisType.X)
				{
					xvec = vector3;
					zvec = vector2;
				}
				else if (this.sourceAxisType == global::Expression.LookAt.AxisType.RevX)
				{
					xvec = -vector3;
					zvec = -vector2;
				}
				else if (this.sourceAxisType == global::Expression.LookAt.AxisType.Z)
				{
					xvec = -vector2;
					zvec = vector3;
				}
				else if (this.sourceAxisType == global::Expression.LookAt.AxisType.RevZ)
				{
					xvec = vector2;
					zvec = -vector3;
				}
				break;
			case global::Expression.LookAt.AxisType.Z:
			case global::Expression.LookAt.AxisType.RevZ:
				zvec = vector;
				if (this.sourceAxisType == global::Expression.LookAt.AxisType.X)
				{
					xvec = vector3;
					yvec = -vector2;
				}
				else if (this.sourceAxisType == global::Expression.LookAt.AxisType.RevX)
				{
					xvec = -vector3;
					yvec = vector2;
				}
				else if (this.sourceAxisType == global::Expression.LookAt.AxisType.Y)
				{
					xvec = vector2;
					yvec = vector3;
				}
				else if (this.sourceAxisType == global::Expression.LookAt.AxisType.RevY)
				{
					xvec = -vector2;
					yvec = -vector3;
				}
				break;
			}
			if (this.limitAxisType == global::Expression.LookAt.AxisType.None)
			{
				this.trfLookAt.rotation = this.LookAtQuat(xvec, yvec, zvec);
			}
			else
			{
				this.trfLookAt.rotation = this.LookAtQuat(xvec, yvec, zvec);
				global::ConvertRotation.RotationOrder order = (global::ConvertRotation.RotationOrder)this.rotOrder;
				Quaternion localRotation = this.trfLookAt.localRotation;
				Vector3 vector4 = global::ConvertRotation.ConvertDegreeFromQuaternion(order, localRotation);
				Quaternion q = Quaternion.Slerp(localRotation, Quaternion.identity, 0.5f);
				Vector3 vector5 = global::ConvertRotation.ConvertDegreeFromQuaternion(order, q);
				if (this.limitAxisType == global::Expression.LookAt.AxisType.X)
				{
					if ((vector4.x < 0f && vector5.x > 0f) || (vector4.x > 0f && vector5.x < 0f))
					{
						vector4.x *= -1f;
					}
					vector4.x = Mathf.Clamp(vector4.x, this.limitMin, this.limitMax);
				}
				else if (this.limitAxisType == global::Expression.LookAt.AxisType.Y)
				{
					if ((vector4.y < 0f && vector5.y > 0f) || (vector4.y > 0f && vector5.y < 0f))
					{
						vector4.y *= -1f;
					}
					vector4.y = Mathf.Clamp(vector4.y, this.limitMin, this.limitMax);
				}
				else if (this.limitAxisType == global::Expression.LookAt.AxisType.Z)
				{
					if ((vector4.z < 0f && vector5.z > 0f) || (vector4.z > 0f && vector5.z < 0f))
					{
						vector4.z *= -1f;
					}
					vector4.z = Mathf.Clamp(vector4.z, this.limitMin, this.limitMax);
				}
				this.trfLookAt.localRotation = global::ConvertRotation.ConvertDegreeToQuaternion(order, vector4.x, vector4.y, vector4.z);
			}
		}

		// Token: 0x0600128A RID: 4746 RVA: 0x00096718 File Offset: 0x00094918
		public virtual Vector3 GetUpVector()
		{
			Vector3 result = Vector3.up;
			if (this.trfUpAxis)
			{
				switch (this.upAxisType)
				{
				case global::Expression.LookAt.AxisType.X:
					result = this.trfUpAxis.right;
					break;
				case global::Expression.LookAt.AxisType.Y:
					result = this.trfUpAxis.up;
					break;
				case global::Expression.LookAt.AxisType.Z:
					result = this.trfUpAxis.forward;
					break;
				}
			}
			return result;
		}

		// Token: 0x0600128B RID: 4747 RVA: 0x00096790 File Offset: 0x00094990
		public virtual Quaternion LookAtQuat(Vector3 xvec, Vector3 yvec, Vector3 zvec)
		{
			float num = 1f + xvec.x + yvec.y + zvec.z;
			if (num == 0f)
			{
				return Quaternion.identity;
			}
			float num2 = Mathf.Sqrt(num) / 2f;
			if (float.IsNaN(num2))
			{
				return Quaternion.identity;
			}
			float num3 = 4f * num2;
			if (num3 == 0f)
			{
				return Quaternion.identity;
			}
			float x = (yvec.z - zvec.y) / num3;
			float y = (zvec.x - xvec.z) / num3;
			float z = (xvec.y - yvec.x) / num3;
			return new Quaternion(x, y, z, num2);
		}

		// Token: 0x0400184A RID: 6218
		public string lookAtName = string.Empty;

		// Token: 0x0400184B RID: 6219
		public string targetName = string.Empty;

		// Token: 0x0400184C RID: 6220
		public global::Expression.LookAt.AxisType targetAxisType = global::Expression.LookAt.AxisType.Z;

		// Token: 0x0400184D RID: 6221
		public string upAxisName = string.Empty;

		// Token: 0x0400184E RID: 6222
		public global::Expression.LookAt.AxisType upAxisType = global::Expression.LookAt.AxisType.Y;

		// Token: 0x0400184F RID: 6223
		public global::Expression.LookAt.AxisType sourceAxisType = global::Expression.LookAt.AxisType.Y;

		// Token: 0x04001850 RID: 6224
		public global::Expression.LookAt.AxisType limitAxisType = global::Expression.LookAt.AxisType.None;

		// Token: 0x04001851 RID: 6225
		public global::Expression.LookAt.RotationOrder rotOrder = global::Expression.LookAt.RotationOrder.ZXY;

		// Token: 0x04001852 RID: 6226
		[Range(-180f, 180f)]
		public float limitMin;

		// Token: 0x04001853 RID: 6227
		[Range(-180f, 180f)]
		public float limitMax;

		// Token: 0x020002F2 RID: 754
		public enum AxisType
		{
			// Token: 0x04001858 RID: 6232
			X,
			// Token: 0x04001859 RID: 6233
			Y,
			// Token: 0x0400185A RID: 6234
			Z,
			// Token: 0x0400185B RID: 6235
			RevX,
			// Token: 0x0400185C RID: 6236
			RevY,
			// Token: 0x0400185D RID: 6237
			RevZ,
			// Token: 0x0400185E RID: 6238
			None
		}

		// Token: 0x020002F3 RID: 755
		public enum RotationOrder
		{
			// Token: 0x04001860 RID: 6240
			XYZ,
			// Token: 0x04001861 RID: 6241
			XZY,
			// Token: 0x04001862 RID: 6242
			YXZ,
			// Token: 0x04001863 RID: 6243
			YZX,
			// Token: 0x04001864 RID: 6244
			ZXY,
			// Token: 0x04001865 RID: 6245
			ZYX
		}
	}

	// Token: 0x020002F4 RID: 756
	[Serializable]
	public class Correct
	{
		// Token: 0x0600128C RID: 4748 RVA: 0x00096848 File Offset: 0x00094A48
		public Correct()
		{
			this.trfCorrect = null;
			this.trfReference = null;
		}

		// Token: 0x17000294 RID: 660
		// (get) Token: 0x0600128D RID: 4749 RVA: 0x0009687C File Offset: 0x00094A7C
		// (set) Token: 0x0600128E RID: 4750 RVA: 0x00096884 File Offset: 0x00094A84
		public Transform trfCorrect { get; private set; }

		// Token: 0x17000295 RID: 661
		// (get) Token: 0x0600128F RID: 4751 RVA: 0x00096890 File Offset: 0x00094A90
		// (set) Token: 0x06001290 RID: 4752 RVA: 0x00096898 File Offset: 0x00094A98
		public Transform trfReference { get; private set; }

		// Token: 0x06001291 RID: 4753 RVA: 0x000968A4 File Offset: 0x00094AA4
		public virtual void SetCorrectTransform(Transform trf)
		{
			this.trfCorrect = trf;
		}

		// Token: 0x06001292 RID: 4754 RVA: 0x000968B0 File Offset: 0x00094AB0
		public virtual void SetReferenceTransform(Transform trf)
		{
			this.trfReference = trf;
		}

		// Token: 0x06001293 RID: 4755 RVA: 0x000968BC File Offset: 0x00094ABC
		public virtual void Update()
		{
			if (null == this.trfCorrect || null == this.trfReference)
			{
				return;
			}
			if (this.calcType == global::Expression.Correct.CalcType.Euler)
			{
				global::ConvertRotation.RotationOrder order = (global::ConvertRotation.RotationOrder)this.rotOrder;
				Vector3 vector = global::ConvertRotation.ConvertDegreeFromQuaternion(order, this.trfCorrect.localRotation);
				Vector3 vector2 = global::ConvertRotation.ConvertDegreeFromQuaternion(order, this.trfReference.localRotation);
				Quaternion q = Quaternion.identity;
				Vector3 vector3 = Vector3.zero;
				if (this.charmRate != 0f)
				{
					q = Quaternion.Slerp(this.trfReference.localRotation, Quaternion.identity, this.charmRate);
					vector3 = global::ConvertRotation.ConvertDegreeFromQuaternion(order, q);
				}
				if (this.useRX)
				{
					float num = Mathf.InverseLerp(0f, 90f, Mathf.Clamp(Mathf.Abs(vector2.x), 0f, 90f));
					num = Mathf.Lerp(this.valRXMin, this.valRXMax, num);
					vector.x = vector2.x * num;
					if (this.charmRate != 0f && ((vector2.x < 0f && vector3.x > 0f) || (vector2.x > 0f && vector3.x < 0f)))
					{
						vector.x *= -1f;
					}
				}
				if (this.useRY)
				{
					float num = Mathf.InverseLerp(0f, 90f, Mathf.Clamp(Mathf.Abs(vector2.y), 0f, 90f));
					num = Mathf.Lerp(this.valRYMin, this.valRYMax, num);
					vector.y = vector2.y * num;
					if (this.charmRate != 0f && ((vector2.y < 0f && vector3.y > 0f) || (vector2.y > 0f && vector3.y < 0f)))
					{
						vector.y *= -1f;
					}
				}
				if (this.useRZ)
				{
					float num = Mathf.InverseLerp(0f, 90f, Mathf.Clamp(Mathf.Abs(vector2.z), 0f, 90f));
					num = Mathf.Lerp(this.valRZMin, this.valRZMax, num);
					vector.z = vector2.z * num;
					if (this.charmRate != 0f && ((vector2.z < 0f && vector3.z > 0f) || (vector2.z > 0f && vector3.z < 0f)))
					{
						vector.z *= -1f;
					}
				}
				this.trfCorrect.localRotation = global::ConvertRotation.ConvertDegreeToQuaternion(order, vector.x, vector.y, vector.z);
			}
			else if (this.calcType == global::Expression.Correct.CalcType.Quaternion)
			{
				Quaternion localRotation = this.trfCorrect.localRotation;
				if (this.useRX)
				{
					localRotation.x = this.trfReference.localRotation.x * (this.valRXMin + this.valRXMax) * 0.5f;
				}
				if (this.useRY)
				{
					localRotation.y = this.trfReference.localRotation.y * (this.valRYMin + this.valRYMax) * 0.5f;
				}
				if (this.useRZ)
				{
					localRotation.z = this.trfReference.localRotation.z * (this.valRZMin + this.valRZMax) * 0.5f;
				}
				this.trfCorrect.localRotation = localRotation;
			}
		}

		// Token: 0x04001866 RID: 6246
		public string correctName = string.Empty;

		// Token: 0x04001867 RID: 6247
		public string referenceName = string.Empty;

		// Token: 0x04001868 RID: 6248
		public global::Expression.Correct.CalcType calcType;

		// Token: 0x04001869 RID: 6249
		public global::Expression.Correct.RotationOrder rotOrder = global::Expression.Correct.RotationOrder.ZXY;

		// Token: 0x0400186A RID: 6250
		[Range(0f, 1f)]
		public float charmRate;

		// Token: 0x0400186B RID: 6251
		public bool useRX;

		// Token: 0x0400186C RID: 6252
		[Range(-1f, 1f)]
		public float valRXMin;

		// Token: 0x0400186D RID: 6253
		[Range(-1f, 1f)]
		public float valRXMax;

		// Token: 0x0400186E RID: 6254
		public bool useRY;

		// Token: 0x0400186F RID: 6255
		[Range(-1f, 1f)]
		public float valRYMin;

		// Token: 0x04001870 RID: 6256
		[Range(-1f, 1f)]
		public float valRYMax;

		// Token: 0x04001871 RID: 6257
		public bool useRZ;

		// Token: 0x04001872 RID: 6258
		[Range(-1f, 1f)]
		public float valRZMin;

		// Token: 0x04001873 RID: 6259
		[Range(-1f, 1f)]
		public float valRZMax;

		// Token: 0x020002F5 RID: 757
		public enum CalcType
		{
			// Token: 0x04001877 RID: 6263
			Euler,
			// Token: 0x04001878 RID: 6264
			Quaternion
		}

		// Token: 0x020002F6 RID: 758
		public enum RotationOrder
		{
			// Token: 0x0400187A RID: 6266
			XYZ,
			// Token: 0x0400187B RID: 6267
			XZY,
			// Token: 0x0400187C RID: 6268
			YXZ,
			// Token: 0x0400187D RID: 6269
			YZX,
			// Token: 0x0400187E RID: 6270
			ZXY,
			// Token: 0x0400187F RID: 6271
			ZYX
		}
	}

	// Token: 0x020002F7 RID: 759
	[Serializable]
	public class ScriptInfo
	{
		// Token: 0x06001295 RID: 4757 RVA: 0x00096CDC File Offset: 0x00094EDC
		public virtual void Update()
		{
			if (!this.enable)
			{
				return;
			}
			if (this.enableLookAt && this.lookAt != null)
			{
				this.lookAt.Update();
			}
			if (this.enableCorrect && this.correct != null)
			{
				this.correct.Update();
			}
		}

		// Token: 0x06001296 RID: 4758 RVA: 0x00096D38 File Offset: 0x00094F38
		public virtual void UpdateArrow()
		{
		}

		// Token: 0x06001297 RID: 4759 RVA: 0x00096D3C File Offset: 0x00094F3C
		public virtual void Destroy()
		{
		}

		// Token: 0x06001298 RID: 4760 RVA: 0x00096D40 File Offset: 0x00094F40
		public virtual void DestroyArrow()
		{
		}

		// Token: 0x04001880 RID: 6272
		public string elementName = string.Empty;

		// Token: 0x04001881 RID: 6273
		public bool enable = true;

		// Token: 0x04001882 RID: 6274
		public bool enableLookAt;

		// Token: 0x04001883 RID: 6275
		public global::Expression.LookAt lookAt = new global::Expression.LookAt();

		// Token: 0x04001884 RID: 6276
		public bool enableCorrect;

		// Token: 0x04001885 RID: 6277
		public global::Expression.Correct correct = new global::Expression.Correct();

		// Token: 0x04001886 RID: 6278
		public int index;

		// Token: 0x04001887 RID: 6279
		public int categoryNo;
	}
}
